<?php

declare (strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Model;

class InformationHouseSales extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'information_house_sales';
    public function information()
    {
        return $this->belongsTo(Information::class, 'information_id');
    }
    public function city()
    {
        return $this->belongsTo(City::class, 'city_id');
    }
    public function info()
    {
        return ['title' => $obj->title ?? '', 'city_id' => $obj->city_id ?? '', 'city' => $this->city->name ?? '', 'village' => $this->village ?? '', 'address' => $this->address ?? '', 'address_location' => ['lat' => $obj->lat ?? '', 'lng' => $obj->lng ?? ''], 'area' => $this->area ?? 0.0, 'total' => $this->total ?? 0.0, 'house_type' => $this->house_type ?? '', 'content' => $this->content ?? ''];
    }
}